package com.example.seckill.auth.dto;

import com.example.seckill.auth.entity.SuccessSeckilled;
import com.example.seckill.system.tools.SeckillEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * 秒杀执行后的结果
 * @author HL
 */
@Setter
@Getter
@AllArgsConstructor
public class SeckillExecution {

    private long seckillId;

    private int state;

    private String stateInfo;

    private SuccessSeckilled successSeckilled;



    public SeckillExecution(long seckillId, SeckillEnum seckillEnum, SuccessSeckilled successSeckilled) {
        this.seckillId = seckillId;
        this.state = seckillEnum.getCode();
        this.stateInfo = seckillEnum.getMsg();
        this.successSeckilled = successSeckilled;
    }

    public SeckillExecution(long seckillId, SeckillEnum seckillEnum) {
        this.seckillId = seckillId;
        this.state = seckillEnum.getCode();
        this.stateInfo = seckillEnum.getMsg();
    }
}
